package com.wssnail.oss.utils;

import java.util.Random;

/**
* @ClassName: FileNameUtils
* @Description:生成文件名
* @author  熟透的蜗牛
* @date 2021年1月4日 上午10:33:47
*
*/
public class FileNameUtils {

	public static String getString(int length) {

		char[] charArray = new char[length];

		for (int i = 0; i < length; i++) {
			Random r = new Random();
			int n = r.nextInt(123);
			while (n < 48 || (n > 57 && n < 65) || (n > 90 && n < 97) || n > 122) {
				n = r.nextInt(123);
			}
			charArray[i] = (char) n;
		}

		return String.valueOf(charArray);
	}

	public static void main(String[] args) {
		System.out.println(getString(15));
	}
}
